<?php
if (!init()) {
  redirect('?action=login');
}

if (checkCommentAuthor($_GET['tid'], $_GET['cid'])) {
  $deleteResultSet = deleteTopicComment($_GET['cid'], $_GET['tid']);

  $initiatorAction = \controller\ControllerUtil::getEncodedActionFromUrlWithParameters($_SERVER['HTTP_REFERER'] . "#lmsg");

  if ($deleteResultSet) {
    redirect("?action=msg&header=header.topic.comment.delete.success&body=body.topic.comment.delete.success&view=" . $initiatorAction);
  } else {
    redirect("?action=msg&header=header.topic.comment.delete.failed&body=body.topic.comment.delete.failed&view=" . $initiatorAction);
  }

}

